#ifndef SNAKE_APP_H
#define SNAKE_APP_H

#include <SDL3/SDL.h>
#include "snake_game.h"
#include "common/resource_manager.h"

class SnakeApp
{
    private:
    SDL_Window *window;
    SDL_Renderer *renderer;
    SnakeGame game;
    Uint64 last_step;
    SDL_Joystick *joystick;
    ResourceManager resourceManager;

    void releaseJoyStick();

    public:
    SnakeApp();
    ~SnakeApp();

    SDL_AppResult openWindow();
    void closeWindow();
    SDL_AppResult iterate();
    void openJoyStick(SDL_JoystickID id);
    void closeJoyStick(SDL_JoystickID id);
    SDL_AppResult handle_hat_event(Uint8 hat);
    SDL_AppResult handle_key_event(SDL_Scancode key_code);
};

#endif